import request from '@/axios/request';
import url from '@/axios/url';
const { mesUrl, adminUrl } = url();
// 导出url
export const exportUrl = `${mesUrl}mesProdOrder/export`
// 导出url-子表
export const exportUrlSub = `${mesUrl}mesScanRecord/export`

// 获取详情
export function getInfo (id = '') {
  return request({
    url: `${mesUrl}mesProdOrder/info/${id}`,
    method: 'get'
  })
}
// 获取详情-子表
export function subGetInfo (id = '') {
  return request({
    url: `${mesUrl}mesScanRecord/info/${id}`,
    method: 'get'
  })
}

//分页查询
export function getList(params = {}) {
  return request({
    url: `${mesUrl}mesProdOrder`,
    method: 'get',
    params,
  });
}
//分页查询-子表
export function subGetList(params = {}) {
  return request({
    url: `${mesUrl}mesScanRecord`,
    method: 'get',
    params,
  });
}

//新增
export function rowCreate(data = {}) {
  return request({
    url: `${mesUrl}mesProdOrder`,
    method: 'post',
    data,
  });
}
//新增-子表
export function subRowCreate(data = {}) {
  return request({
    url: `${mesUrl}mesScanRecord`,
    method: 'post',
    data,
  });
}

//修改
export function rowUpdate(data = {}) {
  return request({
    url: `${mesUrl}mesProdOrder`,
    method: 'put',
    data,
  });
}
//修改-子表
export function subRowUpdate(data = {}) {
  return request({
    url: `${mesUrl}mesScanRecord`,
    method: 'put',
    data,
  });
}

//删除
export function rowDel(id) {
  return request({
    url: `${mesUrl}mesProdOrder/${id}`,
    method: 'put',
  });
}
//删除-子表
export function subRowDel(id) {
  return request({
    url: `${mesUrl}mesScanRecord/${id}`,
    method: 'put',
  });
}

//下拉框字典等
// 查询订单状态：未开始，进行中，已完成，待下发，已下发列表
export function getOrderStatusList() {
  return request({
    url: 'TODO',
    method: 'get',
  });
}
// 查询线体编码列表
export function getLineCodeList() {
  return request({
    url: 'TODO',
    method: 'get',
  });
}

//下拉框字典等-子表
